package com.alan.tbschedule.task;

import com.alan.tbschedule.model.TaskModel;
import com.taobao.pamirs.schedule.IScheduleTaskDealSingle;
import com.taobao.pamirs.schedule.TaskItemDefine;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;

/**
 * Created by liufan
 * 2018-12-18
 */
@Component("singleTask")
public class SingleTask implements IScheduleTaskDealSingle<TaskModel> {
    @Override
    public boolean execute(TaskModel taskModel, String s) throws Exception {

        System.out.println("SingleTask ====execute");
        return true;
    }

    @Override
    public List<TaskModel> selectTasks(String taskParameter,String ownSign,int taskQueueNum,
                                       List<TaskItemDefine> taskItemList,int eachFetchDataNum) throws Exception {
        System.out.println(taskParameter);
        List<TaskModel> list = new ArrayList<>();
        TaskModel o = new TaskModel();
        o.setName("abc");
        list.add(o);

//        System.out.println("taskItemList : " + taskItemList.toString());
//        System.out.println("eachFetchDataNum : "+eachFetchDataNum);
        System.out.println("SingleTask ====selectTasks");
        return null;
    }

    @Override
    public Comparator<TaskModel> getComparator() {
        return null;
    }
}
